package cc.mrbird.plan.domain;

import cc.mrbird.common.annotation.ExportConfig;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Table(name="plan_rehearse")
public class Rehearse implements Serializable {
    /**
     * 单位ID、单位名称、计划类型（此类安全演练）、计划起始时间（年月日时间）、
     * 结束时间（可确定到年月日时间）、演练地点、演练内容，演练机构等。
     */

    private static final long serialVersionUID = 7780821232635882525L;
    @Id
    @GeneratedValue(generator = "JDBC")
    @Column(name = "rehearse_id")
    private Integer rehearse_id;

    @Column(name = "unit_id")
    @ExportConfig(value = "单位id")
    private Integer unit_id;

    @Column(name = "unit_name")
    @ExportConfig(value = "单位名称")
    private String unit_name;

    @Column(name = "plan_type")
    @ExportConfig(value = "计划类型")
    private String plan_type;

    @Column(name = "rehearse_start_time")
    @ExportConfig(value = "计划开始时间")
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date rehearse_start_time;
    @Column(name = "rehearse_end_time")
    @ExportConfig(value = "计划结束时间")
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date rehearse_end_time;
    @Column(name = "rehearse_place")
    @ExportConfig(value = "演练地点")
    private String rehearse_place;
    @Column(name = "rehearse_content")
    @ExportConfig(value = "演练内容")
    private String rehearse_content;
    @Column(name = "rehearse_institutions")
    @ExportConfig(value = "演练机构")
    private String rehearse_institutions;
    @Column(name = "rehearse_status")
    private Integer rehearse_status;    //0:待提交、1:执行中、2:已完成
    @ExportConfig(value = "演练状态")
    private String  rehearse_statusStr;

    public Integer getRehearse_id() {
        return rehearse_id;
    }

    public void setRehearse_id(Integer rehearse_id) {
        this.rehearse_id = rehearse_id;
    }

    public Integer getUnit_id() {
        return unit_id;
    }

    public void setUnit_id(Integer unit_id) {
        this.unit_id = unit_id;
    }

    public String getUnit_name() {
        return unit_name;
    }

    public void setUnit_name(String unit_name) {
        this.unit_name = unit_name;
    }

    public String getPlan_type() {
        return plan_type;
    }

    public void setPlan_type(String plan_type) {
        this.plan_type = plan_type;
    }

    public Date getRehearse_start_time() {
        return rehearse_start_time;
    }

    public void setRehearse_start_time(Date rehearse_start_time) {
        this.rehearse_start_time = rehearse_start_time;
    }

    public Date getRehearse_end_time() {
        return rehearse_end_time;
    }

    public void setRehearse_end_time(Date rehearse_end_time) {
        this.rehearse_end_time = rehearse_end_time;
    }

    public String getRehearse_place() {
        return rehearse_place;
    }

    public void setRehearse_place(String rehearse_place) {
        this.rehearse_place = rehearse_place;
    }

    public String getRehearse_content() {
        return rehearse_content;
    }

    public void setRehearse_content(String rehearse_content) {
        this.rehearse_content = rehearse_content;
    }

    public String getRehearse_institutions() {
        return rehearse_institutions;
    }

    public void setRehearse_institutions(String rehearse_institutions) {
        this.rehearse_institutions = rehearse_institutions;
    }

    public Integer getRehearse_status() {
        return rehearse_status;
    }

    public void setRehearse_status(Integer rehearse_status) {
        this.rehearse_status = rehearse_status;
    }

    public String getRehearse_statusStr() {
        //0:待提交、1:执行中、2:已完成
        if(rehearse_status==0){
            rehearse_statusStr="待提交";
        }
        if(rehearse_status==1){
            rehearse_statusStr="执行中";
        }
        if(rehearse_status==2){
            rehearse_statusStr="已完成";
        }
        return rehearse_statusStr;
    }

    public void setRehearse_statusStr(String rehearse_statusStr) {
        this.rehearse_statusStr = rehearse_statusStr;
    }

    @Override
    public String toString() {
        return "Rehearse{" +
                "rehearse_id=" + rehearse_id +
                ", unit_id=" + unit_id +
                ", unit_name='" + unit_name + '\'' +
                ", plan_type='" + plan_type + '\'' +
                ", rehearse_start_time=" + rehearse_start_time +
                ", rehearse_end_time=" + rehearse_end_time +
                ", rehearse_place='" + rehearse_place + '\'' +
                ", rehearse_content='" + rehearse_content + '\'' +
                ", rehearse_institutions='" + rehearse_institutions + '\'' +
                ", rehearse_status=" + rehearse_status +
                ", rehearse_statusStr='" + rehearse_statusStr + '\'' +
                '}';
    }
}
